<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
for (const platform of ['android', 'mac', 'unix', 'win']) {
    if (window.internals)
        internals.settings.setEditingBehavior(platform);
    const details = platform === 'mac'
        ? 'The content in the deleted paragraph should be moved into the last table cell unless that content is another table.'
        : 'The content in the deleted paragraph should not be merged into the table above.';
    const description = `${platform}: Deleting when the caret is at the start of a paragraph just after a table. ${details}`;
    selection_test(
      [
        '<div contenteditable>',
            '<table><tbody><tr>',
                    '<td>abc</td>',
             '</tr></tbody></table>',
             '<div>|XYZ</div>',
        '</div>'
      ],
      'Delete',
      platform === 'mac'
        ? [
            '<div contenteditable>',
                '<table><tbody><tr>',
                    '<td>abc|XYZ</td>',
                '</tr></tbody></table>',
            '</div>'
          ]
        : [
            '<div contenteditable>',
                '<table><tbody><tr>',
                    '<td>abc</td>',
                '</tr></tbody></table>',
                '|XYZ',
            '</div>'
          ],
      description);
}
</script>
